<?php
/**
 *	@package WordPress
 *	@subpackage Carbon_Paper
 */
get_header();
?>

<div class="clear"></div>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="posts">

<div class="day">

	<p class="date"><?php  echo ucwords(get_the_time('D j M')) ?><br /><?php the_time('Y') ?></p>
	<h2><?php the_title() ?></h2>

	<div class="post-info">
		<span class="info-label">Post&eacute;  &agrave;</span>
		<span class="info-data"><?php the_time('G:i'); ?></span>
	</div>
	<div class="post-info">
		<span class="info-label">Auteur</span>
		<span class="info-data"><a href="<?php the_author_email(); ?>"><?php the_author(); ?></a></span>

	</div>


	<div class="post-info">
		<span class="info-label">Evaluation</span>
		<span class="info-data">
			<div class="stars">
				<a href="" class="stars-<?php $my_rate = get_post_meta($post->ID,'my_rate',1); if ($my_rate == ''): echo '1'; else: echo $my_rate; endif; ?>"><img src="<?php bloginfo('template_directory');?>/images/1-star.gif" alt="Stars" width="14" height="14" /></a>
			</div>
			<div class="clear"></div>

		</span>
	</div>
	<div class="post-info">
		<span class="info-label">Cat&eacute;gories</span>
		<span class="info-data"><?php the_category(', ') ?></span>
	</div>
	<?php if (get_the_tags()): ?>
	<div class="post-info">
		<span class="info-label">Tags</span>
		<span class="info-data"><?php the_tags( '', ', ', ''); ?></span>
	</div>
	<?php endif;?>
	<?php
        $my_thumb = get_post_meta($post->ID,'my_thumb01',1) . get_post_meta($post->ID,'my_thumb02',1) . get_post_meta($post->ID,'my_thumb03',1) ;
        $my_layout = get_post_meta($post->ID,'my_layout',1);
        if ($my_thumb == ''): ?>
            <div class="body-lead">
  	      	   <div class="info-label">Contenu</div>
                   <?php edit_post_link(' (Edit)', '', ''); ?>
  		   <div class="first">
                     <?php the_content(); ?>
	             <?php wp_link_pages(array('before' => '<p style="text-align:right"><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                   </div>
  	    </div><!-- /.body-lead -->
	<?php elseif ($my_layout == 'portrait'):?>
            <div class="body-lead portrait">
  		   <?php the_content(); ?>
  	    </div><!-- /.body-lead -->
	<?php else :?>
            <div class="body-lead landscape">
  		   <?php the_content(); ?>
  	    </div><!-- /.body-lead -->
	<?php endif;?>
	<?php $my_link = get_post_meta($post->ID,'my_link',1); if ($my_link != ''): ?>
	<div class="clear"></div>
	<div class="post-info post-info-elsewhere">
		<span class="info-label">Lien</span>
		<span class="info-data">

			<div class="elsewhere-link"><a target="blank" href="<?php echo $my_link ?>">VOIR CE LIEN</a></div>
		</span>
	</div>
	<?php endif;?>
	<div class="clear"></div>
	<div class="post-info" style="border-bottom:0px; clear:both;">
		<span class="info-label">Partage</span>
		<span class="info-data">
			<a target="blank" title="Partager '<?php the_title()?>' sur FaceBook" href="http://www.facebook.com/share.php?u=<?php the_permalink()?>&t=<?php urlencode(the_title())?>">
				<img src="<?php bloginfo('template_url');?>/images/facebook.png"/>
			</a>
			<a target="blank" title="Partager '<?php the_title()?>' sur MSN-Live" href="http://favorites.live.com/quickadd.aspx?url=<?php the_permalink()?>&title=<?php urlencode(the_title())?>">
				<img src="<?php bloginfo('template_url');?>/images/live.png"/>
			</a>
			<a target="blank" title="Partager '<?php the_title()?>' sur Myspace" href="http://www.myspace.com/Modules/PostTo/Pages/?t=<?php urlencode(the_title())?>&c=<?php the_permalink()?>">
				<img src="<?php bloginfo('template_url');?>/images/myspace.png"/>
			</a>
			<a target="blank" title="Partager '<?php the_title()?>' sur Google Bookmarks" href="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=<?php the_permalink()?>&title=<?php urlencode(the_title())?>">
				<img src="<?php bloginfo('template_url');?>/images/google.png"/>
			</a>
		</span>
	</div>
	<div class="clear"></div>
</div><!-- /.day -->

<?php comments_template(); ?>

</div><!-- /#posts -->
<?php endwhile; else: ?>
<div class="post">
	<h2>No matching results</h2>
	<div class="entry">
		<p>You seem to have found a mis-linked page or search query with no associated results. Please trying your search again. If you feel that you should be staring at 		

something a little more concrete, feel free to email the author of this site or browse the archives.</p>
	</div>
</div><!-- /#posts -->
<?php endif; ?>
<?php include (TEMPLATEPATH . '/second-column-post.php'); ?>
<?php get_template_part('third-column','shared'); ?>
<?php get_footer(); ?>
</div><!-- /home or articles -->